<h1>Listing accommodations</h1>

<table>
  <tr>
    <th>Guest cpf</th>
    <th>Room num</th>
    <th>Num persons</th>
    <th>Emp cpf</th>
    <th>Request</th>
    <th>Arrive date</th>
    <th>Exit date</th>
  </tr>

<% @accommodations.each do |accommodation| %>
  <tr>
    <td><%=h accommodation.guest_cpf %></td>
    <td><%=h accommodation.room_num %></td>
    <td><%=h accommodation.num_persons %></td>
    <td><%=h accommodation.emp_cpf %></td>
    <td><%=h accommodation.request_id %></td>
    <td><%=h accommodation.arrive_date %></td>
    <td><%=h accommodation.exit_date %></td>
    <td><%= link_to 'Show', accommodation %></td>
    <td><%= link_to 'Edit', edit_accommodation_path(accommodation) %></td>
    <td><%= link_to 'Destroy', accommodation, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New accommodation', new_accommodation_path %>
<%= link_to 'Back', :controller => "home#index" %>